﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Sobiens.WPF.Controls.Styles.DataGridGeneric"
	xmlns:WpfToolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:Primitives="clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit"
	xmlns:ExtendedGridControl="clr-namespace:Sobiens.WPF.Controls.ExtendedGridControl"
	xmlns:UserControls="clr-namespace:Sobiens.WPF.Controls.UserControls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!-- Value converters -->
    <BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" />
    <ContextMenu x:Key="DataGridHeaderColumnChooser" StaysOpen="True" HorizontalContentAlignment="Stretch" Width="Auto" HorizontalAlignment="Stretch">
        <MenuItem StaysOpenOnClick="True" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
            <MenuItem.Header>
                <UserControls:ColumnChooserControl></UserControls:ColumnChooserControl>
            </MenuItem.Header>
        </MenuItem>
    </ContextMenu>

    <!-- DataGridColumnHeader Right Gripper Style -->
    <Style x:Key="ColumnHeaderRightGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
							Background="{TemplateBinding Background}">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- DataGridColumnHeader Left Gripper Style -->
    <Style x:Key="ColumnHeaderLeftGripperStyle" 
		   BasedOn="{StaticResource ColumnHeaderRightGripperStyle}" 
		   TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Name="Border"
							Padding="{TemplateBinding Padding}" 
							Background="{TemplateBinding Background}">
                        <Canvas>
                            <Line RenderOptions.EdgeMode="Aliased" Stroke="#88B0E4"
								  X1="7" Y1="{Binding ElementName=Border, Path=ActualHeight}"
								  X2="7" Y2="0"/>
                        </Canvas>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridRowHeader Gripper -->
    <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Height" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeNS"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
							Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>